<?php
    include 'base.php';

    $id = $_POST['id'];
    $imgUrl = $_POST['imgUrl'];
    $href = $_POST['href'];
    $title = $_POST['title'];

    $sql = "UPDATE `banner` SET `imgUrl`='$imgUrl',`href`='$href',`title`='$title' WHERE `id`=$id";

    $res = $conn -> query($sql);

    if ($res) {
        echo json_encode(array(
            'code' => 0,
            'msg' => '修改成功',
            'data' => null
        ));
    } else {
        echo json_encode(array(
            'code' => 1,
            'msg' => '修改失败',
            'data' => null
        ));
    }
?>